#include "Thread.hpp"
#include <unistd.h>

using namespace ThreadModlue;

int main()
{
    Thread t([](){
        while(true)
        {
            char name[64];
            pthread_getname_np(pthread_self(), name, sizeof(name));
            std::cout << "我是一个新线程:" << name << std::endl;
            sleep(1);
        } });

    t.Start();
    t.Detach();
    sleep(5);

    t.Stop();
    sleep(5);

    t.Join();

    return 0;
}